package com.example.Test;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.json.JSONUtil;

public class test {
    public static void main(String[] args) {
//        A a = new A();
//        a.setName("aaa");
//        a.setCode("aaa");
//        B b = new B();
//        b.setA(a);
//        b.setAge("bbb");
//        b.setTitle("bbb");
//        C c = new C();
//        c.setContent("ccc");
//        BeanUtil.copyProperties(b, c);
//        System.out.println(c.toString());
        C c = JSONUtil.toBean("{\"age\":\"18\",\"title\":\"XXX\",\"content\":\"XXX\",\"name\":\"YYY\"}", C.class);
        System.out.println(c.toString());
    }
}
